package com.aoxon.cargo.service;

import java.util.Map;

import android.util.Log;

import com.aoxon.cargo.bean.GsonBean;
import com.aoxon.cargo.util.DataUtil;
import com.aoxon.cargo.util.HttpUtil;
import com.google.gson.Gson;

/**
 * 服务类模板模型
 * 
 * @author ZZJ
 * 
 */
public abstract class MyService {

	protected String url;
	protected String suffix = ".action?";
	protected Gson gson = DataUtil.gson;
	protected Map<String, String> params;

	protected GsonBean doPost() {
		try {
			Log.v("doPost", HttpUtil.BASE_URL + url+":"+ params);
			String result = HttpUtil.doPost(HttpUtil.BASE_URL + url, params);
			GsonBean gsonBean = gson.fromJson(result, GsonBean.class);
			return gsonBean;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
		
	}
	   public GsonBean execute(int startIndex, int length) {
	        return null;
	    }

}
